<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title111</title>
    <link rel="stylesheet" href="/css/supplies/bootstrap.min.css"/>
    <link rel="stylesheet" href="/css/loading.css">
    <link rel="stylesheet" href="/css/supplies/common.css"/>
    <link rel="stylesheet" href="/icon/css/font-awesome.min.css">
    <link rel="stylesheet" href="/js/supplies/bootstrap-table/bootstrap-table.min.css">
    <link rel="stylesheet" href="/js/supplies/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <link rel="stylesheet" href="/css/supplies/supply/supply.css"/>
    <style>
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
        }
        input[type="number"]{
            -moz-appearance: textfield;
        }
        [v-cloak] {
            display: none;
        }
        body {
            padding: 0px 20px 20px 20px;
        }
        .table tr {
        }

        .table thead {
            height: 60px;
            background-color: #FFECE0;
        }

        .fixed-table-pagination {
            margin-top: 20px;
        }

        .input-group-addon {
            background-color: white;
        !important;
        }
        .input-style[type="checkbox"] {
            -webkit-appearance: none;  /*清除复选框默认样式*/
            background: #fff url(/image/supplies/blue.png);   /*复选框的背景图，就是上图*/
            height: 19px;   /*高度*/
            vertical-align: middle;
            width: 19px;
            border: none;
        }
        .input-style[type="checkbox"]:checked {
            background-position: -19px 0;
        }

        .form-control {
            height: 44px;
        }
        .upload_img{
            float: left;
        }
        .upload_img .form-group{
            float: left;
            width: 80px;
            height: 80px;
            margin-right: 10px;
        }
        .upload_img .form-group .img_remove_a{
            position: absolute;
            top: 0;
            left: 80px;
        }
        .upload_img .form-group img{
            width: 100%;
            height: 100%;
        }
        .file_detail {
            margin-top: 15px;
            position: relative;
            display: block;
            border: 1px solid #DEDEDE;
            overflow: hidden;
            text-decoration: none;
            text-indent: 0;
            width: 80px;
            height: 80px;
            background-image: url(/image/supplies/upload_image.png);
            background-repeat: no-repeat;
            background-position: center;
            background-size: 30px 30px;
            cursor: pointer;
        }


        .input_check {
            position: absolute;
            width: 20px;
            height: 20px;
            visibility: hidden;
            background: #E92333;
        }

        .input_check_span {
            position: relative;
            top: 20px;
            left: 5px;
        }

        .input_check {
            display: none;
        }

        .input_check_span label {
            padding-left: 17px;
            cursor: pointer;
            position: relative;
            height: 18px;
            margin-bottom: 35px;
            width: 19px;     /* 如果没有文字，打开这段样式*/
            background: white;
            border: 1px solid #DEDEDE;
        }
        .input_check_span label::after {
            content: '';
            opacity: 0; /*设置复选框标签透明度0.2,半透明的对勾 下面悬停时候加深*/
            position: absolute;
            width: 12px;
            height: 8px;
            background: transparent;
            top: 2px;
            left: 3px;
            border: 2px solid #FF6A0E;
            border-top: none;
            border-right: none;
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            transform: rotate(-45deg);
        }
        .input_check_span label:hover::after {
            opacity: 0;
        }
        .input_check_span input[type=checkbox]:checked + label:after { /*checkbox选中后，设置相邻元素对勾为不透明*/
            opacity: 1;
        }
        .input_check_span input[type=checkbox]:checked + label{
            border: 1px solid #FF6A0E;
        }
    </style>
</head>
<body>



<!--标签-->
<ul id="myTab" class="nav nav-tabs">
    <li class="active">
        <a href="#commodity" data-toggle="tab">
            <span class="font_size_14">商品列表</span>
            </br>
            <span class="font_size_14 en_title">product list</span>
            <div class="title-bottom-border"></div>
        </a>

    </li>
    <li>
        <a href="#saveCommodity" data-toggle="tab">
            <span class="font_size_14">新增商品</span>
            </br>
            <span class="font_size_14 en_title">newly added products</span>
            <div class="title-bottom-border"></div>
        </a>
    </li>
    <li>
        <a href="#discount" data-toggle="tab">
            <span class="font_size_14">优惠管理</span>
            </br>
            <span class="font_size_14 en_title">promotion management</span>
            <div class="title-bottom-border"></div>
        </a>

    </li>
    <li>
        <a href="#saveDiscount" data-toggle="tab">
            <span class="font_size_14">新增优惠</span>
            </br>
            <span class="font_size_14 en_title">new offer</span>
            <div class="title-bottom-border"></div>
        </a>

    </li>
</ul>

<div id="myTabContent" v-cloak class="tab-content">
    <div class="modal fade font_size_14" id="changeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width: 800px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title font_size_16" id="changeModalLabel">修改库存价格<br/><span class="color-6"> Modify the stock and price</span></h4>
                </div>
                <div class="modal-body">
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group " >商品库存<br/>
                            <span class="color-6"> product stock </span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="form-group unit" >
                                <span>{{productInfo.unit}}</span>
                            </div>
                            <div class="shop_input_content">
                                <span class="shop_input_tips "  >   </span>
                                <input type="number" v-model="productInfo.stock" class="shop_input_val " isvalid="yes" checkexpession="Double"  errormsg="输入不正确<br>Incorrectly input" />
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group ">售价<br/>
                            <span class="color-6"> price </span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="form-group unit" >   ￡  </div>
                            <div class="shop_input_content">
                                <span class="shop_input_tips"  >   </span>
                                <input type="number" class="shop_input_val" v-model="productInfo.price"
                                       isvalid="yes" checkexpession="Double" errormsg="输入不正确<br>Incorrectly input"  />
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                </div>
                <div class="modal-footer">
                    <label  class="btn_cancel" data-dismiss="modal">取消(cancel)</label>
                    <label  class="btn_save btn-2" v-on:click="updateProduct()">确定(determine)</label>
                </div>
            </div>
        </div>
    </div>
    <div class="tab-pane fade in active" id="commodity">
        <!--搜索-->
        <div class="checkHead search_form">
            <div class="form-inline commodity_td">
                <div class="form-group category">
                    <span class="font_size_14">分类(可多选)</span>
                    </br>
                    <span class="font_size_14">classification</span>
                </div>
                <div class="check-btns form-group" >
                    <ul id="myCheckboxArea">
                        <div class="hidDiv" id="category">
                            <div class="category_checkbox form-inline">
                                <label v-for="item in category.category" style="font-weight:normal;">
                                    <input type="checkbox" class="form-group" style="display: none"
                                           v-model="searchData.category.category_ids" :value="item.id"/>
                                    <span class="form-group" @click="setCheckboxSelect($event)">{{item.name}}</br>{{item.name_english}}</span>
                                </label>
                            </div>
                            <div class="select_a yesBtn btn-2 choose-btn"
                                 v-on:click="getType('category_ids','type','search')" onclick="determine(0)">确定(determine)</div>
                        </div>
                        <div class="hidDiv" id="type">
                            <div class="category_checkbox form-inline">
                                <label v-for="item in category.type" style="font-weight:normal;">
                                    <input type="checkbox" class="form-group"  style="display: none"
                                           v-model="searchData.category.type_ids" :value="item.id"/>
                                    <span class="form-group" @click="setCheckboxSelect($event)">{{item.name}}</br>{{item.name_english}}</span>
                                </label>
                            </div>
                            <div class="select_a yesBtn btn-2 choose-btn"
                                 v-on:click="getType('type_ids','small_type','search')" onclick="determine(1)" >确定(determine)</div>
                        </div>
                        <div class="hidDiv" id="small_type">
                            <div class="category_checkbox form-inline">
                                <label v-for="item in category.small_type" style="font-weight:normal;">
                                    <input type="checkbox" class="form-group" style="display: none"
                                           v-model="searchData.category.small_type_ids" :value="item.id"/>
                                    <span class="form-group" @click="setCheckboxSelect($event)">{{item.name}}</br>{{item.name_english}}</span>
                                </label>
                            </div>
                            <div class="select_a yesBtn btn-2 choose-btn" v-on:click="getBrand('small_type','search')" onclick="determine(2)">确定(determine)</div>
                        </div>
                        <div class="hidDiv" id="brand">
                            <div class="category_checkbox form-inline">
                                <label v-for="item in category.brand" style="font-weight:normal;">
                                    <input type="checkbox" class="form-group" style="display: none"
                                           v-model="searchData.category.brand_ids" :value="item.id"/>
                                    <span class="form-group" @click="setCheckboxSelect($event)">{{item.name_english}}</span>
                                </label>
                            </div>
                            <div class="select_a yesBtn btn-2 choose-btn" onclick="determine(3)">确定(determine)</div>
                        </div>
                        <li>
                            <button class="check-btn color-9" onclick="checkBtn(0)">
                                <span class="font_size_14">类别选择</span>
                                </br>
                                <span class="font_size_14">type selection</span>
                            </button>
                            <div class="button_san"></div>
                            <div class="top_san"></div>
                            <div id="triangle1" class="action"></div>
                        </li>
                        <li>
                            <button class="check-btn color-9" onclick="checkBtn(1)">
                                <span class="font_size_14">种类选择</span>
                                </br>
                                <span class="font_size_14">product type selection</span>
                            </button>
                            <div class="top_san"></div>
                            <div class="button_san"></div>
                            <div id="triangle2" class="action"></div>
                        </li>
                        <li>
                            <button class="check-btn color-9" onclick="checkBtn(2)">
                                <span class="font_size_14">品类选择</span>
                                </br>
                                <span class="font_size_14">category selection</span>
                            </button>
                            <div class="top_san"></div>
                            <div class="button_san"></div>
                            <div id="triangle3" class="action"></div>
                        </li>
                        <li>
                            <button class="check-btn color-9" onclick="checkBtn(3)">
                                <span class="font_size_14">品牌选择</span>
                                </br>
                                <span class="font_size_14">brand selection</span>
                            </button>
                            <div class="top_san"></div>
                            <div class="button_san"></div>
                            <div id="triangle4" class="action"></div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="form-inline commodity_td" style="margin-top: 20px;">
                <div class="price_left">
                    <div class="form-group font_size_14">
                        <span >价格</span>
                        </br>
                        <span class="color-6">price</span>
                    </div>
                    <div class="form-group" style="margin-left: 22px;">
                        <div class="form-inline" >
                            <div class="form-group"
                                 style="width: 40px;border: 1px solid #dedede;height: 44px;text-align: center;line-height: 44px;">
                                <span class="font_size_14">￡</span>
                            </div>
                            <div class="form-group">
                                <input v-model="searchData.price.down" type="text" class="Price"
                                       style="height:44px;line-height:44px;margin-left: -6px;margin-right:0px;width: 100px;"/>
                            </div>
                            <div class="form-group"
                                 style="width: 30px;height: 40px;text-align: center;line-height: 40px;">
                                <span>—</span>
                            </div>
                            <div class="form-group"
                                 style="width: 40px;border: 1px solid #dedede;height: 44px;text-align: center;line-height: 44px;">
                                <span class="font_size_14">￡</span>
                            </div>
                            <div class="form-group">
                                <input v-model="searchData.price.up" type="text" class="Price"
                                       style="height:44px;line-height:44px;margin-left: -5px;margin-right:0px;width: 100px;"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="price_right">
                    <div class="form-group font_size_14">
                        <span >库存</span>
                        </br>
                        <span class="color-6">stock</span>
                    </div>
                    <div class="form-group " style="margin-left: 20px">

                        <div class="form-inline" >
                            <div class="form-group">
                                <input v-model="searchData.stock.down" type="text" class="inStock"
                                       style="height:44px;line-height:44px;margin-right:0px;width: 100px;border-right: 0"/>
                            </div>
                           <!-- <div class="form-group"
                                 style="width: 40px;border: 1px solid #dedede;height: 44px;text-align: center;line-height: 44px;margin-left: -6px;">
                                <span class="font_size_14">kg</span>
                            </div>-->
                            <div class="form-group"
                                 style="width: 30px;height: 44px;text-align: center;line-height: 44px;">
                                <span>—</span>
                            </div>
                            <div class="form-group">
                                <input v-model="searchData.stock.up" type="text" class="inStock"
                                       style="height:44px;line-height:44px;margin-right:0px;width: 100px;"/>
                            </div>
                            <!--<div class="form-group"
                                 style="width: 40px;border: 1px solid #dedede;height: 44px;text-align: center;line-height: 44px;margin-left: -5px;">
                                <span class="font_size_14">kg</span>
                            </div>-->
                        </div>
                    </div>
                </div>
            </div>
            <div style="clear: both"></div>
            <div class="form-inline font_size_14" style="margin-top: 20px;">
                <div class="price_left">
                    <div class="form-group">
                        <span >搜索</span>
                        </br><span class="color-6">search</span>
                    </div>
                    <div class="form-group" style="margin-left: 20px;position: relative;">
                        <div class="placeholder" > 请输入商品名<br/>please enter product name
                        </div>
                        <input v-model="searchData.name" type="text" style="width:284px;height:44px;line-height:44px;" maxlength="50"
                               class="search input_placeholder"/>
                    </div>
                </div>
                <div class="price_right font_size_14">
                    <div class="form-group" style="margin-right: 20px">
                        <span >上架状态</span>
                        </br>
                        <span class="color-6">shelf status</span>
                    </div>
                    <div class="form-group addedState" >
                        <div class="form-inline" >
                            <div
                                 class="select_a  supply_status active_a_supply"
                                 v-on:click="setStatus('is_shelves','1,2,3,5')">全部</br><span style="color: #666;">all</span></div>
                            <div
                                 class="select_a  supply_status "
                                 v-on:click="setStatus('is_shelves','1')">上架中</br><span style="color: #666;">available</span></div>
                            <div
                                 class="select_a  supply_status "
                                 v-on:click="setStatus('is_shelves','2')">已下架</br><span style="color: #666;">not available</span></div>
                            <div
                                 class="select_a  supply_status "
                                 v-on:click="setStatus('is_shelves','3')">审核中</br><span style="color: #666;">under review</span></div>
                            <div class="select_a  supply_status "
                                    v-on:click="setStatus('is_shelves','5')">审核未通过</br><span style="color: #666;">not audited</span></div>
                        </div>
                    </div>
                </div>
            </div>
            <div style="clear: both"></div>
                <div class="form-inline select_btn" >
                    <div class="form-group">
                        <div v-on:click="searchs(1)" class="select_a form-group btn_color"
                             style="width:100px;height:32px;line-height: 32px;color: white;cursor: pointer;">
                            <span class="font_size_14">查找search</span>
                        </div>
                        <div v-on:click="restForm()" class="select_a form-group btn_color"
                             style="width:100px;height:32px;line-height: 32px;color: white;margin-left: 28px;cursor: pointer;">
                            <span class="font_size_14">重置reset</span>
                            <br/></div>
                    </div>
                </div>
            <div style="clear: both"></div>
        </div>

            <!--列表-->
            <div class="supply-table" style="margin-bottom: 100px;" v-loading="loading">

                <table class="myTable" style="margin-top: 0px" id="product" >
                    <thead>
                    <tr>
                        <td>
                            <!--<span class="input_check_span"><input type="checkbox" id="all" class="input_check"-->
                            <!--/><label for="all" onclick="swapCheck('product')"></label></span>-->
                            <!--<input type="checkbox" onclick="swapCheck('product')"/>--></td>
                        <td><span class="font_size_14">商品ID</span><br/><span class="font_size_14">product ID</span></td>
                        <td><span class="font_size_14">商品名称</span><br/><span class="font_size_14">product name</span></td>
                        <td><span class="font_size_14">价格</span><br/><span class="font_size_14">Price</span></td>
                        <td><span class="font_size_14">库存</span><br/><span class="font_size_14">stock</span></td>
                        <td><span class="font_size_14">实际销量</span><br/><span class="font_size_14">actual sales</span></td>
                        <td><span class="font_size_14">分类</span><br/><span class="font_size_14">clossification</span></td>
                        <td><span class="font_size_14">品牌</span><br/><span class="font_size_14">brand</span></td>
                        <td><span class="font_size_14">操作</span><br/><span class="font_size_14">operate</span></td>
                    </tr>
                    </thead>

                    <tbody>
                    <tr v-for="(item,index) in supplyList.rows">
                        <td><span class="input_check_span"><input type="checkbox" :id="index" name="ids" class="input_check"
                                                                  :value="item.id"/><label :for="index"></label></span></td>
                        <td class="font_size_14" style="font-size: 16px;">{{item.id}}</td>
                        <td class="font_size_14">{{item.name}}<br/><span class="font_size_14" style="color:#666;">{{item.name_english}}</span>
                        </td>
                        <td class="font_size_14" style="font-size: 16px;">￡{{item.price}}</td>
                        <td class="font_size_14" style="font-size: 16px;">{{item.stock}}{{item.unit}}</td>
                        <td class="font_size_14" style="font-size: 16px;">{{item.sale_num}}</td>
                        <td class="font_size_14">{{item.category_id}}<br/><span
                                class="font_size_14">{{item.name_english}}</span></td>
                        <td class="font_size_14">{{item.brand_id}}<br/><span
                                class="font_size_14" style="color:#666;">{{item.name_english}}</span></td>
                        <td class="font_size_14">
                            <div class='cont_box'>
                                <a href='javascript:void(0);' :value="item.id" v-if="item.is_shelves == 1"
                                   class='status_a' v-on:click='upDownProduct(2,item.id)'>下架<br/>on shelf</a>
                                <a href='javascript:void(0);' :value="item.id" v-if="item.is_shelves == 2"
                                   class='status_a' v-on:click='upDownProduct(1,item.id)'>上架<br/>off shelf</a>
                                <div  v-if="item.is_shelves == 3"
                                   class='status_a'>审核中<br/>under review</div>
                                <a href='javascript:void(0);' v-on:click="lookReson(item.id)" :value="item.id" v-if="item.is_shelves == 5"
                                   class='status_a' >查看原因<br/>reason</a>
                                <div class='delete_a' style="cursor: pointer;"
                                     v-on:click='delProduct(1,1,item.id,"")'></div>
                                <div class='change_a' style="cursor: pointer;"
                                     v-on:click='changeProduct(item.id,item.stock,item.price,item.unit)'></div>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>

                <div class="myPage form-inline" style="margin-top: 30px;">
                    <div class="select_a form-group btn_color"
                         v-on:click="delProduct(1,2,2,'product')"
                         style="width:100px;height:32px;line-height: 32px;color: white;cursor: pointer;">
                        <span class="font_size_14">删除delete</span>
                    </div>
                    <div class="myPage_lower form-group" style="float: right;margin: 0px;margin-top: 5px;" v-on:click="supplyListInit(2,supplyList.page,10)">
                        <input type="hidden" :value="supplyList.page+1">
                    </div>
                    <div class="myPage_upper form-group" style="float: right;margin: 0px;margin-right: 12px;margin-top: 5px;" v-on:click="supplyListInit(1,supplyList.page,10)">
                        <input type="hidden" :value="supplyList.page-1"/>
                    </div>
                    <div class="myPage_total_num form-group" style="float: right;margin: 0px;margin-right: 12px;">
                    <span class="font_size_14">共{{supplyList.total}}条记录<br/>
                        <span class="font_size_14">total {{supplyList.total}} records</span>
                    </span>
                    </div>
                </div>

            </div>



    </div>

    <!--新增商品-->
    <div class="tab-pane fade" id="saveCommodity" v-loading="loading">
        <div class="save_commodity_td form-inline" style="border-bottom: 0;">
            <span class="form-group commodity_title_span font_size_14">商品名称</br>
                <span class="font_size_14 color-6">product name</span></span>
            <div class="placeholder" style="margin-top: -2px;margin-left: 157px;width: 400px;">
                <span class="font_size_14">请输入商品名</span><br/><span
                    class="font_size_14">please enter product name</span>
            </div>
            <input v-model="saveData.product.name" isvalid="yes" checkexpession="NotNull" errormsg="请输入商品名<br>please enter product name"
                   type="text" class="no_border_input form-group input_placeholder"  maxlength="50"
                   style="width: 284px;"/>
        </div>
        <div class="save_commodity_td form-inline" style="border-bottom: 0;">
            <span class="form-group commodity_title_span font_size_14" style="margin-top: -44px;">商品简介</br>
                <span class="font_size_14 color-6">product description</span></span>
            <div class="placeholder" style="margin-top: -2px;margin-left: 157px;width: 1277px;height: 88px;">
                <span class="font_size_14">请输入商品简介</span><br/><span
                    class="font_size_14 ">please enter product description</span>
            </div>
            <textarea v-model="saveData.product.description" class="form-group input_placeholder"  maxlength="200"
                      style="width: 80%;height: 88px;padding: 5px;resize: none;" isvalid="yes" checkexpession="NotNull" errormsg="请输入商品简介<br>please enter product description"
            ></textarea>
        </div>
        <div class="save_commodity_td form-inline" style="border-bottom: 0;">
            <span class="form-group commodity_title_span font_size_14">商品产地</br>
                <span class="font_size_14" style="color: #666666;">Origin of goods</span></span>
            <div class="placeholder" style="margin-top: -2px;margin-left: 157px;width: 400px;">
                <span class="font_size_14">请输入商品产地</span><br/><span class="font_size_14">please enter the origin of the goods</span>
            </div>
            <input v-model="saveData.product.origin" type="text" class="no_border_input form-group input_placeholder"  maxlength="50"
                   isvalid="yes" checkexpession="NotNull" errormsg="请输入商品产地<br>please enter the origin of the goods"
                   style="width: 284px;">
        </div>
        <div class="form-inline save_commodity_td border_1">
            <span class="form-group commodity_title_span font_size_14">分类选择</br>
                <span class="font_size_14" style="color: #666666;">category selection</span></span>
            <div class="form-group group-li">
                <div style="position: relative;background-color: white;border: 1px solid #DEDEDE;width: 164px;height: 44px;text-align: left;padding-left: 15px;" click_div="leibie" class="select_a select_a_onclick font_size_14 b" onclick="myAddCheck(0)">
                    <div class="button_san1"></div>
                    <div class="font_size_14" id="category_ids">
                        类别选择</br>
                        <span >type selection</span>
                    </div>

                </div>
                <div class="select_a_div_triangle"></div>
            </div>
            <!--<div class="form-group">-->
            <!--<input type="text" id="category_ids" class="bottom_input" readonly="readonly"/>-->
            <!--</div>-->
            <div class="form-group group-li">
                <div style="margin-left:20px;position: relative;background-color: white;border: 1px solid #DEDEDE;width: 164px;height: 44px;text-align: left;padding-left: 15px;" class="select_a select_a_onclick font_size_14 b"  onclick="myAddCheck(1)">
                    <div class="button_san1"></div>

                    <div id="type_ids" class="font_size_14">
                        种类选择</br>Kind of choice
                    </div>
                </div>
                <div class="select_a_div_triangle"></div>
            </div>
            <!--<div class="form-group">-->
            <!--<input type="text" id="type_ids" class="bottom_input" readonly="readonly"/>-->
            <!--</div>-->
            <div class="form-group group-li">
                <div style="margin-left:20px;position: relative;background-color: white;border: 1px solid #DEDEDE;width: 164px;height: 44px;text-align: left;padding-left: 15px;" class="select_a select_a_onclick font_size_14 b"  onclick="myAddCheck(2)">
                    <div class="button_san1"></div>

                    <div id="small_type_ids" class="font_size_14">
                        品类选择</br>category selection
                    </div>
                </div>
                <div class="select_a_div_triangle"></div>
            </div>
            <!--<div class="form-group">-->
            <!--<input type="text" id="small_type_ids" class="bottom_input" readonly="readonly"/>-->
            <!--</div>-->
            <div class="form-group group-li">
                <div style="margin-left:20px;position: relative;background-color: white;border: 1px solid #DEDEDE;width: 164px;height: 44px;text-align: left;padding-left: 15px;" class="select_a select_a_onclick font_size_14 b"  onclick="myAddCheck(3)">
                    <div class="button_san1"></div>

                    <div id="brand_ids" class="font_size_14">
                        品牌选择</br>brand selection
                    </div>
                </div>
                <div class="select_a_div_triangle"></div>
            </div>

            <div class="select_a_div" id="leibie">
                <div class="category_checkbox form-inline">
                    <label v-for="item in new_category.category" style="font-weight:normal;">
                        <input type="checkbox" class="form-group category_check"
                               onclick="checkSingle('category_ids',this)"
                               v-model="addProductType.category_ids" :value="item.id" />
                        <span class="form-group " style="margin-left: 30px;  margin-top: -40px;">{{item.name}}</br>{{item.name_english}}</span>
                    </label>
                </div>
                <div v-on:click="getType('category_ids','type','newProduct')"
                   class="select_a yesBtn font_size_14 btn_color" onclick="myDetermine(0)">确定(determine)</div>
            </div>

            <!--<div class="select_a_div_triangle" id="select_a_div_triangle1"></div>-->
            <div class="select_a_div" id="zhonglei">
                <div class="category_checkbox form-inline">
                    <label v-for="item in new_category.type" style="font-weight:normal;">

                        <input type="checkbox" class="form-group kind_check" v-model="addProductType.type_ids"
                               :value="item.id" onclick="checkSingle('type_ids',this)" />

                        <span class="form-group" style="margin-left: 30px;  margin-top: -25px;">{{item.name}}</br>{{item.name_english}}</span>
                    </label>
                </div>
                <div v-on:click="getType('type_ids','small_type','newProduct')"
                   class="select_a yesBtn font_size_14 btn_color" style="cursor: pointer" onclick="myDetermine(1)">确定(determine)</div>
            </div>
            <!--<div class="select_a_div_triangle" id="select_a_div_triangle2"></div>-->
            <div class="select_a_div" id="zhonglei1">
                <div class="category_checkbox form-inline">
                    <label v-for="item in new_category.small_type" style="font-weight:normal;">

                        <input type="checkbox" class="form-group kind1_check"
                               v-model="addProductType.small_type_ids"
                               :value="item.id" onclick="checkSingle('small_type_ids',this)"/>

                        <span class="form-group" style="margin-left: 30px;  margin-top: -25px;">{{item.name}}</br>{{item.name_english}}</span>
                    </label>
                </div>
                <div class="select_a yesBtn font_size_14 btn_color" v-on:click="getBrand('zhonglei1','newProduct')" style="cursor: pointer" onclick="myDetermine(2)">确定(determine)</div>
            </div>
            <!--<div class="select_a_div_triangle" id="select_a_div_triangle3"></div>-->
            <div class="select_a_div" id="pinpai">
                <div class="category_checkbox form-inline">
                    <label v-for="item in new_category.brand" style="font-weight:normal;">
                        <input type="checkbox" class="form-group brand_check" v-model="addProductType.brand_ids"
                               :value="item.id" onclick="checkSingle('brand_ids',this)"/>
                        <span class="form-group" style="margin-left: 30px;  margin-top: -40px;">{{item.name_english}}</span>
                    </label>
                </div>
                <div class="select_a yesBtn font_size_14 btn_color" style="cursor: pointer" onclick="myDetermine(3)">确定(determine)</div>
            </div>
        </div>
        <div class="save_commodity_td border_1">
            <div class=" font_size_14 " style="margin-top: 20px">
                <span>给商品添加橱窗图片</span></br>
                <span class="color-6">add a picture of the product</span>
            </div>
            <div>
                <div class="img upload_img"></div>
                <div class="file_detail" style="margin-top: 10px">
                    <input type="file" @change="uploadImg" id="img" accept="image/jpeg,image/png,image/jpg"
                           multiple="multiple">

                </div>
            </div>
        </div>
        <div class="save_commodity_td border_1" >
            <div class="padding_t_b form-inline font_size_14 border_1" style="display: flex;justify-content: flex-start;flex-flow: row wrap;">
                <div class="price_left" style="width: 320px;margin:10px 0 ;">
                    <div class="price_l" >
                        <span >单价<br> price</span>
                    </div>
                    <div class="price_l">
                        <div style="position: absolute">
                            <div class="placeholder" >
                                请输入商品单价<br/>Please enter the product price </div>
                            <input v-model="saveData.product.price" style="width: 230px;" type="text" onblur="checkNum(this)" class="no_border_input input_placeholder"
                                   isvalid="yes" checkexpession="Double" errormsg="请输入商品单价<br>Please enter the product price">
                        </div>

                    </div>
                </div>
                <div style="float: left;width: 320px;margin:10px 0 ;">
                    <div class="price_l" >
                        <span >数量<br> number</span>
                    </div>
                    <div class="price_l">
                        <div style="position: absolute">
                            <div class="placeholder" >
                                请输入商品数量<br/>Please enter the number</div>
                            <input v-model="saveData.product.number" style="width: 230px;" type="text" class="no_border_input input_placeholder">
                        </div>

                    </div>
                </div>
                <div style="float: left;width: 320px;margin:10px 0 ;">
                    <div class="price_l" >
                        <span >单位<br> unit</span>
                    </div>
                    <div class="price_l">
                        <div style="position: absolute">
                            <div class="placeholder" >
                                请输入商品单位<br/>Please enter the unit</div>
                            <input v-model="saveData.product.unit" style="width: 230px;" type="text" class="no_border_input input_placeholder">
                        </div>

                    </div>
                </div>
                <div style="float: left;width: 320px;margin:10px 0 ;">
                    <div class="price_l" >
                        <span >库存<br>stock</span>
                    </div>
                    <div class="price_l" >
                        <div style="position: absolute">
                            <div class="placeholder" >
                                请输入商品库存<br/>Please enter the product stock</div>
                            <input v-model="saveData.product.stock" type="text" style="width: 230px;" onblur="checkNum(this)" class="no_border_input input_placeholder"
                                   isvalid="yes" checkexpession="Double" errormsg="请输入商品库存<br>Please enter the product namePlease enter the product stock" >
                        </div>

                    </div>

                </div>
                <div style="clear: both"></div>
            </div>
            </div>
            <div class="save_commodity_td " >
            <div class="table-responsive "  >
                <table id="stock_table">
                    <thead>
                    <tr style="text-align: center">
                        <td style="width: 5%;text-align: center;">
                            <div  id="table_button" v-on:click="add()">
                                <img src="/image/supplies/add-product.png" alt="">
                            </div>
                        </td>
                        <td style="width: 25%;text-align: center;">
                            <span class="font_size_14">商品规格数量</span>
                            <br/>
                            <span class="font_size_14">product specifications number</span>
                        </td>
                        <td style="width: 45%;text-align: center;">
                            <span class="font_size_14">商品规格数量</span>
                            <br/>
                            <span class="font_size_14">product specifications unit</span>
                        </td>
                        <td style="width: 45%;text-align: center;">
                            <span class="font_size_14">售价</span>
                            <br/>
                            <span class="font_size_14">sale price</span>
                        </td>
                        <td style="width: 25%;">
                            <span class="font_size_14">操作</span>
                            <br/>
                            <span class="font_size_14">process</span>
                        </Td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(item , index) in Speci.specification" class="font_size_14">
                        <td style="width:  5%;text-align: center;">
                           <!-- <div style="width:19px;margin:0 auto;">
                                <input type="checkbox" class="input-style" :id="index+'speci'" name="ids" :value="index">
                                &lt;!&ndash;<label :for="index+'speci'"></label>&ndash;&gt;
                            </div>-->
                            <!--<span class="input_check_span" style="left: 32px;"><input type="checkbox" :id="index+'speci'" name="ids" class="input_check" :value="index"/><label :for="index+'speci'"></label></span>-->
                        </td>
                        <td style="width: 25%;text-align: center;" v-text="item.number"></td>
                        <td style="width: 45%;text-align: center;" v-text="item.speci"></td>
                        <td style="width: 45%;text-align: center;" v-text="item.price"></td>
                        <td class="form-inline " style="text-align: center;">
                            <div class="form-group save_supply_editImg" v-on:click="edit(index)" style="margin-right:20px;"></div>
                            <div class="form-group save_supply_deleteImg" v-on:click="delSpeci(index)"></div>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div>
        </div>
        <div class="save_commodity_td border_1">
            <div class=" font_size_14 ">
                <span>商品详情图片</span></br>
                <span class="color-6">detailed picture of product</span>
            </div>
            <div>
                <div class="img1 upload_img"></div>
                <div class="file_detail">
                    <input type="file" @change="uploadImg1" id="img1" accept="image/jpeg,image/png,image/jpg"
                           multiple="multiple">

                </div>
            </div>

        </div>

        <div class="save_commodity_td " style="border-bottom: 0;margin-top: 20px">
            <span class="font_size_14" >是否含有增值税</br>
                <span class="font_size_14 color-6">has VAT been added?</span></span>
            <div>
                <label class="productStatus font_size_14 tax_status_click productStatus_click_active">
                    <input v-model="saveData.product.is_include_tax" style="display: none" :value="1" name="tax"
                           type="radio"/>是<br/><span class="color-6">Yes</span>
                </label>
                <label class="productStatus font_size_14 tax_status_click" style="margin-left: 20px;">
                    <input v-model="saveData.product.is_include_tax" style="display: none" :value="0" name="tax"
                           type="radio"/>否<br/><span class="color-6">No</span>
                </label>
            </div>
        </div>
        <div  style="margin-bottom: 30px;border-bottom: 0;">
            <div v-on:Click="addProduct('product')" class="select_a font_size_14 btn_color"
                 style="width:180px;height:32px;margin: 0 auto;color: white;line-height: 30px;cursor: pointer;border: 0;">
                确认新增(confirm newly added)
            </div>
        </div>
        <div style="height: 100px;background-color: #FCF8F5;margin-right: -20px;margin-left: -20px"></div>
    </div>

    <!-- 模态框（Modal）新增规格 -->
    <div class="modal fade font_size_14" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width: 800px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title font_size_16" id="myModalLabel">新增规格价格<br/><span class="color-6"> new specification and price</span></h4>
                </div>
                <div class="modal-body">
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group " >规格商品数量<br/>
                            <span class="color-6">specifications number</span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="shop_input_content">
                                <span class="shop_input_tips "  >   </span>
                                <input   type="text" class="shop_input_val " v-model="Speci.speci.number"
                                       isvalid="yes" checkexpession="Double"  errormsg="输入不正确<br>Incorrectly input" />
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group " >商品规格单位<br/>
                            <span class="color-6">specifications unit</span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="shop_input_content">
                                <span class="shop_input_tips "  >   </span>
                                <input type="text" class="shop_input_val " v-model="Speci.speci.speci"/>
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group ">售价<br/>
                            <span class="color-6"> price </span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="form-group unit" >   ￡  </div>
                            <div class="shop_input_content">
                                <span class="shop_input_tips"  >   </span>
                                <input type="text" class="shop_input_val"v-model="Speci.speci.price"
                                       isvalid="yes" checkexpession="Double" errormsg="输入不正确<br>Incorrectly input"  />
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                </div>
                <div class="modal-footer">
                    <label  class="btn_cancel" data-dismiss="modal">取消(cancel)</label>
                    <label  class="btn_save btn-2" v-on:click="addSpeci()">确定(determine)</label>
                </div>
            </div>
        </div>
    </div>

    <!-- 模态框（Modal）编辑规格 -->
    <div class="modal fade font_size_14" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width: 800px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title font_size_16" id="myModalLabel2">编辑规格价格<br/><span class="color-6"> edit specification and price </span></h4>
                </div>
                <div id="edit" style="display: none"></div>
                <div class="modal-body">
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group " >规格商品数量<br/>
                            <span class="color-6">specifications number</span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="shop_input_content">
                                <span class="shop_input_tips "  >   </span>
                                <input   type="text" class="shop_input_val " v-model="Speci.edit.number"
                                         isvalid="yes" checkexpession="Double"  errormsg="输入不正确<br>Incorrectly input" />
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group " >商品规格单位<br/>
                            <span class="color-6">specifications unit</span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="shop_input_content">
                                <span class="shop_input_tips "  >   </span>
                                <input type="text" class="shop_input_val " v-model="Speci.edit.speci"/>
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                    <div class="form-inline shop_name">
                        <div class="shop_name_spec">
                              <span class="form-group ">售价<br/>
                            <span class="color-6"> price </span>
                        </span>
                        </div>
                        <div class="shop_input">
                            <div class="form-group unit" >   ￡  </div>
                            <div class="shop_input_content">
                                <span class="shop_input_tips"  >   </span>
                                <input type="text" class="shop_input_val"v-model="Speci.edit.price"
                                       isvalid="yes" checkexpession="Double" errormsg="输入不正确<br>Incorrectly input"  />
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                </div>
                <div class="modal-footer">
                    <label  class="btn_cancel" data-dismiss="modal">取消(cancel)</label>
                    <label  class="btn_save btn-2" v-on:click="editSpeci()">确定(determine)</label>
                </div>
            </div>
        </div>
    </div>

    <!--优惠管理-->
    <div class="tab-pane fade" id="discount">
        <div class="checkHead">
            <div class="form-inline commodity_td">
                <div class="form-group" style="width: 100px ; margin-right: 20px;position: relative;">
                    优惠类型</br><span class="font_size_14" style="color: #333333;">discount type</span>
                </div>
                <div class="form-group" >
                    <div class="check-btns form-inline" style="margin-left: 0px;">
                        <div class="form-group" style="margin-right: 15px;">
                            <div v-on:click="setStatus('discount_type','1')"
                               data-status="1" class="select_a full_a_click font_size_14"
                               style="width: 140px;height: 44px;color: #333333;padding-top: 1px;cursor: pointer;">满减</br><span
                                    class="font_size_14" style="color: #666666;">full reduction</span></div>
                        </div>
                        <div class="form-group" style="margin-right: 15px;">
                            <div v-on:click="setStatus('discount_type','2')"
                               data-status="1" class="select_a full_a_click font_size_14"
                               style="width: 140px;height: 44px;color: #333333;padding-top: 1px;cursor: pointer;">满送</br><span
                                    class="font_size_14" style="color: #666666;">free gift*****</span></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-inline commodity_td" style="margin-top: 20px;">
                <div class="form-group" style="width: 100px ; margin-right: 20px;position: relative;">
                    活动状态</br><span class="font_size_14" style="color: #666666;">event status</span>
                </div>
                <div class="form-group" >
                    <div class="check-btns form-inline" style="margin-left: 0px;" >
                        <div class="form-group" style="margin-right: 15px;">
                            <div v-on:click="setStatus('discount_status','1')"
                               data-status="1" class="select_a status_a_click font_size_14"
                               style="width: 140px;height: 44px;color: #333333;padding-top: 1px;cursor: pointer;">进行中</br><span
                                    class="font_size_14" style="color: #666666;">commencing</span></div>
                        </div>
                        <div class="form-group" style="margin-right: 15px;">
                            <div v-on:click="setStatus('discount_status','2')"
                               data-status="1" class="select_a status_a_click font_size_14"
                               style="width: 140px;height: 44px;color: #333333;padding-top: 1px;cursor: pointer;">未开始</br><span
                                    class="font_size_14" style="color: #666666;">ending</span></div>
                        </div>
                       <!-- <div class="form-group" style="margin-right: 15px;">
                            <div v-on:click="setStatus('discount_status','3')"
                               data-status="1" class="select_a status_a_click font_size_14"
                               style="width: 140px;height: 44px;color: #333333;padding-top: 1px;cursor: pointer;">过期</br><span
                                    class="font_size_14" style="color: #666666;">expired</span></div>
                        </div>-->
                    </div>
                </div>
            </div>

            <div class="form-inline" style="margin-top: 20px;">
                <div class="form-group" style="width: 100px ; margin-right: 20px;position: relative;">
                    搜索</br><span class="font_size_14" style="color: #666666;">search</span>
                </div>
                <div class="form-group" style="position: relative;">
                    <div class="placeholder"  >
                        请输入商品名称<br/>please enter the name of discount</div>

                    <input v-model="searchData.product_name" style="height: 44px;width: 284px;" type="text"
                           class="fenlei input_placeholder"/>
                </div>
            </div>
            <div class="form-inline search-btns">
                <div class="form-group">
                    <div v-on:click="searchs(2)"
                         class="select_a form-group font_size_14 btn_color"
                         style="width:100px;height:32px;line-height: 32px; color: white;cursor: pointer;">查找search
                    </div>

                    <div v-on:click="restForm()" class="select_a form-group fon btn_color"
                         style="width:100px;height:32px;line-height: 32px;color: white;margin-left: 28px;cursor: pointer;">
                        重置reset<br/></div>
                </div>
            </div>
            <div style="clear: both"></div>
        </div>

        <div class="table-responsive" v-loading="loading">
            <table class="myTable" id="discounts">
                <thead>
                <tr>
                    <td>
                        <!--<span class="input_check_span"><input type="checkbox" onclick="swapCheck('discounts')" id="discounts_all" name="ids" class="input_check"/><label for="discounts_all"></label></span>-->
                        <!--<input type="checkbox" onclick="swapCheck('discounts')"/>-->
                    </td>
                    <!--<td><span class="font_size_14">活动名称</span><br/><span class="font_size_14">event name</span></td>-->
                    <td><span class="font_size_14">商品名称</span><br/><span class="font_size_14">event name</span></td>
                    <td><span class="font_size_14">活动类型</span><br/><span class="font_size_14">event type</span> </td>
                    <td><span class="font_size_14">有效日期</span><br/><span class="font_size_14">valid date</span></td>
                    <td><span class="font_size_14">创建日期</span><br/><span class="font_size_14">creation date</span></td>
                    <td><span class="font_size_14">操作</span></br><span class="font_size_14">process</span></td>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(item,index) in discountList.rows">
                    <td>
                        <span class="input_check_span"><input type="checkbox" :id="index+'discount'" name="ids" class="input_check"
                                                              :value="item.id"/><label :for="index+'discount'"></label></span>
                        <!--<input type="checkbox" name="ids" :value="item.id"/>-->
                    </td>
                    <!--<td class="font_size_14" style="text-align: center;padding-left: 37px;">{{item.name}}</td>-->
                    <td class="font_size_14" style="text-align: center;padding-left: 37px;">{{item.product_name}}</td>
                    <td class="font_size_14">{{item.type}}</td>
                    <td class="font_size_16" v-html="formatDateTime1(item.start_time,item.end_time)"></td>
                    <td class="font_size_14" v-html="formatDateTime2(item.add_time)"> </td>
                    <td class="font_size_14">
                        <div class='cont_box' style="width:170px;">
                            <a href='javascript:void(0);' :value="item.id" v-if="item.status == 1"
                               class='status_a' v-on:click='upDownDiscount(2,item.id)'>关闭<br/>close</a>
                            <a href='javascript:void(0);' :value="item.id" v-if="item.status == 2"
                               class='status_a ' v-on:click='upDownDiscount(1,item.id)'>开启<br/>open</a>
                            <!--<a href='javascript:void(0);' v-if="item.status == 0"
                               class='status_a' style="width:auto;">已删除<br/>deleted</a>-->
                            <div class='delete_a' style="cursor: pointer;float: right"
                               v-on:click='delProduct(2,1,item.id,"")'></div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="footer">
                <div class="price_left">
                    <div v-on:click="delProduct(2,2,2,'discounts')"
                         class=" font_size_14 btn_color delete-btn" >删除(delete)
                    </div>
                </div>
                <div class="price_right">
                    <div  class="font_size_14 ">
                        <div class="myPage_lower "  v-on:click="discountListInit(2,discountList.page,10)">
                            <input type="hidden" :value="discountList.page-1">
                        </div>
                        <div class="myPage_upper "  v-on:click="discountListInit(1,discountList.page,10)">
                            <input type="hidden" :value="discountList.page+1"/>
                        </div>
                        <div class="count">
                            <span class="color-6" >共{{discountList.total}}条记录 </span><br/>
                            <span class="color-9" >total{{discountList.total}} records</span>
                        </div>
                    </div>
                </div>
                <div style="clear: both"></div>
            </div>
        </div>
    </div>

    <!--新增优惠-->
    <div class="tab-pane fade" id="saveDiscount" v-loading="loading">
        <div class="save_commodity_td form-inline">
            <span class="form-group commodity_title_span font_size_14" style="width: 225px;">请选择优惠类型</br><span
                    class="font_size_14 color-6">please select a discount type</span></span>
            <div class="form-group form-inline">
                <div class="form-group">
                    <div data_value="减"
                         class="select_a active_a reduce_give font_size_14">
                        满减</br>
                        <span class="font_size_14">full reduction</span></div>
                </div>
                <div class="form-group" style="margin-left: 20px">
                    <div data_value="送" class="select_a reduce_give font_size_14">满送</br>
                        <span class="font_size_14">free gift*****</span></div>
                </div>
            </div>
        </div>
        <!--<div class="save_commodity_td form-inline border_1 font_size_14 ">
            <span class="form-group commodity_title_span activity_name" style="width: 225px;">满减活动名称</br><span class="color-6">name of full reduction event</span></span>
            <div class="placeholder placeholder_name" style="margin-left: 250px">
                请输入满减活动名称<br/><span>Please enter the full reduction event</span>
            </div>
            <input v-model="saveData.discount.name" type="text" style="width: 284px;" onblur="checkValue(this) " maxlength="50"
                   class="no_border_input form-group input_placeholder"/>
        </div>-->
        <div class="save_commodity_td form-inline border_1 font_size_14 add-goods" >
            <span class="form-group commodity_title_span "  style="width: 225px;">添加商品</br><span class="color-6">add goods</span></span>
            <div class="placeholder " style="margin-left: 250px">
                添加商品<br/><span>add goods</span>
            </div>
            <input id="supply_modal_show"  type="text" style="width: 284px;"  maxlength="50" v-model="saveData.discount.product_name"  class="no_border_input form-group input_placeholder show-modal"/>
        </div>
        <div class="save_commodity_td border_1" style="margin-top: 20px">
            <span class="font_size_14">有效期</br><span class="color-6">valid date</span></span>
            <div class="form-inline">
                <div class="form-group border_1" style="margin-top: 20px;">
                    <div class="placeholder" style="margin-top:61px;width: 220px;height: 50px"  onclick="getDate('startTime')">选择开始时间<br/>starting date
                        <div class="triangle-down input-f-1 b"  ></div>
                    </div>

                    <input class="input_placeholder" type="text"  style="width:218px;height: 44px"
                           name="startTime" id="startTime"   >
                </div>
                <div class="form-group font_size_14" style="margin-top: 18px;margin-left: 10px;margin-right: 10px;">
                    至<br/>to
                </div>
                <div class="form-group" style="margin-top: 20px;">
                    <div class="placeholder" style="margin-top:61px;width: 220px;height: 50px"  onclick="getDate('endTime')"> 选择结束时间<br/>ending date
                        <div class="triangle-down input-f-2 b"></div>
                    </div>

                    <input class="input_placeholder" type="text"  style="width:218px;height: 44px"
                           name="endTime" id="endTime"   >
                </div>
            </div>
        </div>

        <div id="full-reduce" style="display: block">
            <div class="save_commodity_td font_size_14"  style="margin-top: 20px;height:100px;border-bottom: 0;">
                <span class="guize_zi">满减规则</br><span class='color-6'>terms and conditions of the full reduction</span></span>
                <div style="margin-top: 20px">
                    <div class="form-inline">
                        <div class="input-group font_size_14" >
                            <span class="input-group-addon" style="border-right: 1px">满</span>
                            <div class="placeholder font_size_14 hide_placeholder" style="display: block;width: 90px;">
                                <span >数量</span><br/><span >num</span>
                            </div>
                            <!--<span class="input-group-addon " style="border-right: 0;">￡</span>-->
                            <input class="input-group-addon " type="number"   style="width: 62px;border-left: 0;"
                                    v-model="saveData.discount.condition_num">
                            <span class="input-group-addon" style="width: 30px;border: 0;">一</span>
                            <span class="input-group-addon" >减</span>
                            <span class="input-group-addon " style="border-left: 0;border-right: 0;">￡</span>
                            <div class="placeholder " style="width: 90px;height: 44px;display: block;">
                                <span >金额</span><br/><span >amount</span>
                            </div>
                            <input class="input-group-addon " type="number" v-model="saveData.discount.relief_money"
                                   style="width: 62px;border-left: 0" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="save_commodity_td" style="border: none;height:80px;" >
                <div v-on:Click="addProduct('discount','1')" class="select_a font_size_14 btn_color"
                     style="margin: 0 auto;margin-top:30px;line-height:30px;width:180px;height :32px;color:white;cursor: pointer;border: 0">
                    确认添加(confirm addition)
                </div>
            </div>
        </div>


        <div id="full-give" style="display: none">
            <div class="save_commodity_td font_size_14"  style="margin-top: 20px;height:100px;border-bottom: 0;">
                <span class="guize_zi">满送规则</br><span class='color-6'>terms and conditions of the free gift*****</span></span>
                <div style="margin-top: 20px">
                    <div class="form-inline">
                        <div class="input-group font_size_14" >
                            <span class="input-group-addon" style="border-right: 1px">满</span>
                            <div class="placeholder font_size_14 hide_placeholder" style="display: block;width: 90px;">
                                <span >数量</span><br/><span >num</span>
                            </div>
                            <input class="input-group-addon input_placeholder" type="number" style="width: 101px;"
                                   v-model="saveData.discount.condition_num">

                            <span class="input-group-addon" style="width: 30px;border: 0;">一</span>
                            <span class="input-group-addon" >送</span>
                            <div class="placeholder " style="width: 90px;height: 44px;display: block;">
                                <span >商品</span><br/><span >products</span>
                            </div>
                            <input class="input-group-addon input_placeholder " v-model="saveData.discount.give" type="text"  style="width: 101px;border-left: 0">  <!--id="supply_modal_show"-->

                            <!--<span class="input-group-addon" style="width: 30px;border: 0;">一</span>
                            <span class="input-group-addon" >kg</span>
                            <div class="placeholder " style="width: 90px;height: 44px;display: block;">
                                <span >数量</span><br/><span >number</span>
                            </div>
                            <input class="input-group-addon input_placeholder" type="number"   style="width: 101px;"
                                   v-model="saveData.discount.num">-->

                        </div>
                    </div>
                </div>
            </div>
            <div class="save_commodity_td" style="border: none;height:80px;" >
                <div v-on:Click="addProduct('discount','2')" class="select_a font_size_14 btn_color"
                     style="height:50px;margin: 0 auto;margin-top:30px;line-height:30px;width:180px;height :32px;border: 0;color:white;cursor: pointer;">
                    确认添加(confirm addition)
                </div>
            </div>
        </div>

        </div>

    <!-- 模态框（Modal）选择商品 -->
    <div class="modal fade font_size_14" id="myTypeModal" tabindex="-1" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content" style="width: 800px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title font_size_14" id="myModalLabel1">选择商品<br/><span class="color-6"> please select the products</span></h4>
                </div>
                <div class="modal-body" v-if="giftGoods">
                    <div class="zTreeDemoBackground left"  style="">
                        暂无数据,请添加商品!
                    </div>
                </div>
                <div class="modal-body" v-if="!giftGoods">
                    <div class="zTreeDemoBackground left" id="div_tree" style="">
                        <ul id="treeDemo" class="ztree"></ul>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn_cancel" style="width: 140px"
                            data-dismiss="modal">取消(cancel)
                    </button>
                    <button type="button" class="btn-2 btn_save" onclick="saveGift()" style="width: 140px;border: 0" data-dismiss="modal">确定(determine)
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->

    </div>




</div>
<script rel="script" src="/js/supplies/jquery.min.js"></script>
<script rel="script" src="/js/supplies/bootstrap.min.js"></script>
<script rel="script" src="/js/supplies/bootstrap-table/bootstrap-table.min.js"></script>
<script rel="script" src="/js/supplies/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script rel="script" src="/js/supplies/common.js"></script>
<script rel="script" src="/js/supplies/common_input.js"></script>
<script rel="script" src="/js/vue.js"></script>
<script rel="script" src="/js/vue-resource.js"></script>
<script rel="script" src="/js/loading.js"></script>
<script rel="script" src="/js/supplies/validator/validator.js"></script>
<script rel="script" src="/js/supplies/axios.js"></script>
<script rel="script" src="/js/layer.js"></script>
<script src="/js/supplies/laydate/laydate.js"></script>
<script rel="script" src="/js/supplies/ztree/jquery.ztree.all.min.js"></script>
<script rel="script" src="/js/supplies/supply/supply.js"></script>
<script>




    var suppliesId = localStorage.getItem("suppliesId")
    //树形tree列表
    var setting = {
        view: {
            selectedMulti: false
        },
        async: {
            enable: true,
            url: "/apishop/apishop/getProductGivezTree",
            autoParam: ["name"],
            otherParam: {"supplier_id":suppliesId},
            dataFilter: filter
        },
        callback: {
            beforeClick: beforeClick,
            beforeAsync: beforeAsync,
            onAsyncError: onAsyncError,
            onAsyncSuccess: onAsyncSuccess,
        }
    };

function isShowTips(dom) {

    if(undefined == $(dom).val() || "" == $(dom).val()  ){
        $(dom).prev().css("display","block");
    }else {
        $(dom).prev().css("display","none");
    }
}

    function filter(treeId, parentNode, childNodes) {
        if (!childNodes) return null;
        for (var i = 0, l = childNodes.length; i < l; i++) {
            childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
        }
        return childNodes;
    }

    function beforeClick(treeId, treeNode) {
        if (!treeNode.isParent) {
            {
                // alert(111);
                // $("#txt_area").val(treeNode.name);
                // $("#div_tree").hide();
                // return false;
            }
        } else {
            return true;
        }
    }

    var log, className = "dark";

    function beforeAsync(treeId, treeNode) {
        className = (className === "dark" ? "" : "dark");
        showLog("[ " + getTime() + " beforeAsync ]&nbsp;&nbsp;&nbsp;&nbsp;" + ((!!treeNode && !!treeNode.name) ? treeNode.name : "root"));
        return true;
    }

    function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
        showLog("[ " + getTime() + " onAsyncError ]&nbsp;&nbsp;&nbsp;&nbsp;" + ((!!treeNode && !!treeNode.name) ? treeNode.name : "root"));
    }

    function onAsyncSuccess(event, treeId, treeNode, msg) {
        showLog("[ " + getTime() + " onAsyncSuccess ]&nbsp;&nbsp;&nbsp;&nbsp;" + ((!!treeNode && !!treeNode.name) ? treeNode.name : "root"));
    }

    function showLog(str) {
        if (!log) log = $("#log");
        log.append("<li class='" + className + "'>" + str + "</li>");
        if (log.children("li").length > 8) {
            log.get(0).removeChild(log.children("li")[0]);
        }
    }

    function getTime() {
        var now = new Date(),
            h = now.getHours(),
            m = now.getMinutes(),
            s = now.getSeconds(),
            ms = now.getMilliseconds();
        return (h + ":" + m + ":" + s + " " + ms);
    }
    // 满送商品提交
    function saveGift(){
        var zTree = $.fn.zTree.getZTreeObj("treeDemo");
        var nodes = zTree.getSelectedNodes();
        if ('' == nodes){
            return;
        }
        // console.log(nodes);
        if(nodes[0].isParent){
            layer.msg("请选择具体商品!",{
                skin:'winning-class',//自定义样式winning-class
                time:3000
            });
            return false;
        }
        $("#supply_modal_show").val(nodes[0].name);
        vm.saveData.discount.id             = nodes[0].id;
        vm.saveData.discount.product_name   = nodes[0].name+'(￡'+nodes[0].price+')';
        vm.saveData.discount.product_price  = nodes[0].price;
        tipsHidden();
    }

    function refreshNode(e) {
        var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
            type = e.data.type,
            silent = e.data.silent,
            nodes = zTree.getSelectedNodes();
        //console.log(nodes);
        if (nodes.length == 0) {
            alert("请先选择一个父节点");
        }
        for (var i = 0, l = nodes.length; i < l; i++) {
            zTree.reAsyncChildNodes(nodes[i], type, silent);
            if (!silent) zTree.selectNode(nodes[i]);
        }
    }

    //初始化tree列表
    $(document).ready(function () {
        $.fn.zTree.init($("#treeDemo"), setting);

    });
    $(function () {
        $(".full_a_click").on("click", function () {
            $(".full_a_click").each(function () {
                $(this).removeClass("active_a_full");
            })
            if ($(this).hasClass("active_a_full")) {
                $(this).removeClass("active_a_full");
                return;
            }
            $(this).addClass("active_a_full");
        });
        $(".status_a_click").on("click", function () {
            $(".status_a_click").each(function () {
                $(this).removeClass("active_a_status");
            })
            if ($(this).hasClass("active_a_status")) {
                $(this).removeClass("active_a_status");
                return;
            }
            $(this).addClass("active_a_status");
        });
        $(".supply_status").on("click", function () {
            $(".supply_status").each(function () {
                $(this).removeClass("active_a_supply");
            })
            if ($(this).hasClass("active_a_supply")) {
                $(this).removeClass("active_a_supply");
                return;
            }
            $(this).addClass("active_a_supply");
        });
        $(".product_status_click").on("click", function () {
            $(".product_status_click").each(function () {
                $(this).removeClass("productStatus_click_active");
            })
            $(this).addClass("productStatus_click_active");
        });

        $(".tax_status_click").on("click", function () {
            $(".tax_status_click").each(function () {
                $(this).removeClass("productStatus_click_active");
            })
            $(this).addClass("productStatus_click_active");
        });
        //导航栏
        $('#myTab a').click(function (e) {
            e.preventDefault()
            $(this).tab('show');
            var title = $(this).html();
            if (title.indexOf("商品列表") >= 0) {
                var title = [];
                title[0] = {navTitle: "商品管理", e_navTitle: "product management", titleImg: 1};
                title[1] = {navTitle: "商品列表", e_navTitle: "product list", titleImg: 0};
                window.parent.editTitle(title);
            } else if (title.indexOf("新增商品") >= 0) {
                var title = [];
                title[0] = {navTitle: "商品管理", e_navTitle: "product management", titleImg: 1};
                title[1] = {navTitle: "新增商品", e_navTitle: "newly added products", titleImg: 0};
                window.parent.editTitle(title);
            } else if (title.indexOf("优惠管理") >= 0) {
                var title = [];
                title[0] = {navTitle: "商品管理", e_navTitle: "product management", titleImg: 1};
                title[1] = {navTitle: "优惠管理", e_navTitle: "promotion management", titleImg: 0};
                window.parent.editTitle(title);
            } else if (title.indexOf("新增优惠") >= 0) {
                var title = [];
                title[0] = {navTitle: "商品管理", e_navTitle: "product management", titleImg: 1};
                title[1] = {navTitle: "新增优惠", e_navTitle: "new offer", titleImg: 1};
                title[2] = {navTitle: "满减", e_navTitle: "full reduction", titleImg: 0};
                window.parent.editTitle(title);
            }
        })
        $(".input_placeholder").focus(function(){
            $(this).prev().css("display","none");
        })
    })

    function getDate(location) {
        laydate.render({
            elem: '#' + location,//指定元素
            type:"datetime",
            format:"yyyy-MM-dd HH:mm",
            trigger:'mouseover',
            lang: 'en',//国际版
            showBottom: true, //显示底部,
            done:function () {
                setTimeout(function () {
                    if("" == $("#"+location).val()){
                        $("#"+location).prev().css("display","block");
                    }else {
                        $("#"+location).prev().css("display","none");
                    }
                },200);


        }

        });

    }

    // 添加商品 分类单选
    function checkSingle(name, dom) {
        if ($(dom).prop('checked')) {
            vm.addProductType[name].splice(0, 1);
            vm.addProductType[name][0] = $(dom).val();
            $("#" + name).html($(dom).next().html());
            /*if(name=='brand_ids'){
                $("#" + name).html("<div style='margin-top: 10px'>"+$(dom).next().html()+"</div>");
                console.log($(dom).next().html());
            }else {
                $("#" + name).html($(dom).next().html());
            }*/
        } else {
            vm.addProductType[name].splice(0, 1);
            vm.addProductType[name] = [];

            switch (name){
                case 'category_ids' :
                    $("#" + name).html("类别选择<br>type selection");

                    break ;
                case 'type_ids':
                    $("#" + name).html("种类选择<br>product type selection");
                    break ;
                case 'small_type_ids':
                    $("#" + name).html("品类选择<br>category selection");
                    break ;
                case 'brand_ids':
                    $("#" + name).html("品牌选择<br>brand selection");
                    break ;
                default:
                        break ;
            }

        }
    }

</script>
</body>
</html>